package io.yyxx.boot.business.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.yyxx.boot.business.service.BizUserSyncService;
import io.yyxx.boot.common.enums.SysLogType;
import io.yyxx.boot.config.properties.DingTalkProperties;
import io.yyxx.boot.framework.annotation.Log;
import io.yyxx.boot.framework.response.ApiResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@Tag(name = "账单")
@RequestMapping("/bill")
public class BizBillController {

  @Autowired
  private BizUserSyncService bizUserSyncService;
  @Autowired
  DingTalkProperties dingTalkProperties;

  /**
   * 下载用户信息
   *
   * @return
   * @throws Exception
   */
  @Log(type = SysLogType.UPDATE)
  @Operation(summary = "下载用户信息")
  @PostMapping("/syncUser")
  public ApiResult syncUser() {
    log.info("下载用户信息");



    boolean flag = bizUserSyncService.syncUser();
    return ApiResult.result(flag);
  }

}
